package demo03;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import java.sql.Connection;
import java.sql.SQLException;

public class C3P0Demo02 {
    public static void main(String[] args) throws SQLException {
        //1.创建c3p0连接池对象
        ComboPooledDataSource dataSource = new ComboPooledDataSource();

        //获取数据库连接进行使用
        for (int i = 1; i <= 11; i++) {
            Connection con = dataSource.getConnection();
            System.out.println(i+":"+con);
            if(i==5){
                con.close();
            }
        }
    }
}
